/*
 * @Author: songliusheng
 * @Date: 2018-11-12 10:23:55
 * @Description: ''
 * @Last Modified by: zoushiyong
 * @Last Modified time: 2018-11-23 20:31:00
 * @ToDo: ''
 */

import React from 'react'

function Panel (props) {
  let { accountData } = props
  let availableMoney = 0
  let frozenMoney = 0

  if (accountData) {
    let {availableAmount, frozenAmount} = accountData

    availableAmount = availableAmount.toFixed(2)
    frozenAmount = frozenAmount.toFixed(2)

    availableMoney = T.formatPrice(availableAmount)
    frozenMoney = T.formatPrice(frozenAmount)
  }

  return <div className='money-panel'>
    <span className='panel-img-wrap'>
      <img
        width='280'
        height='144'
        src='/assets/images/valid.png' alt='availableMoney' />
      <span className='money'>
        <div className='f12'>Available Amount</div>
        <div className='f24 tac'>{availableMoney}</div>
      </span>
    </span>
    <span className='panel-img-wrap'>
      <img
        width='280'
        height='144'
        src='/assets/images/freeze.png' alt='frozenMoney' />
      <span className='money'>
        <div className='f12'>Frozen Amount</div>
        <div className='f24 tac'>{frozenMoney}</div>
      </span>
    </span>
  </div>
}
export default Panel
